<?php
// Library File
include 'lib/library.php';

$content .= '
	<script language="javascript" type="text/javascript" src="'.$addr.'/scripts/login.js"></script>
	
';

$scripts .= '<script src="'.$addr.'/scripts/enterKeyPress.js" type="text/javascript"></script>';

if(!isset($m_username)){
	$title = 'Login';
}else{
	$title = 'Logout';
}
$subtitle = 'Please Login';


if(!isset($m_username)){
	$content .= '
	<div class="form">
		<span id="formerrors"></span>
		<h3>Login</h3>
		<form name="login">
			
		<div><P><label for="username">Username: </label><input type="text" id="username" name="username" size="20" onKeyPress="enterKeyPress(event)" /></P></div>
		
		<div><P><label for="password">Password: </label><input type="password" id="password" name="password" size="20" onKeyPress="enterKeyPress(event)" /></P></div>
		
		<input type="button" onclick="ajaxFunction()" name="login" class="submit" value="Login" />
		</form>
	</div>
		
		<P>Or, <fb:login-button onlogin="window.location=\'/index.php\';" size="medium" length="long"></fb:login-button></P>
		
	';
}else if(isset($m_username)){
	$content = '
		<h2>Refresing</h2>
		<P>You are already logged in...</P>
	';
	refresh('/index.php','none',3);
}

/*
**   P U T    V A R S
**    O N    P A G E
*/
	head($title,$style,$scripts);
	body($header,$personal,$subtitle,$content,$navigation);
	foot($footer,$dbc);
?>
